//
//  FreshFoodDetailViewController.swift
//  SmartHousekeeper
//
//  Created by 刘森 on 2020/2/22.
//  Copyright © 2020 LS. All rights reserved.
//

import UIKit

class FreshFoodDetailViewController: UIViewController {
    

    var model: FreshFoodSecondLevelCellModel?
    
    lazy var backButton = UIButton(normalImage: ImageName("fanhuixuanzhong"))
    lazy var detailView: FreshFoodDetailView = {
        let value: FreshFoodDetailView = FreshFoodDetailView()
        value.getTopHeight = getStatusBarHeight()
        return value
    }()
    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = UIColor.white
        
        initWithControl()
        initWithSubscribeSignal()
        detailView.model = self.model
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        self.navigationController?.navigationBar.isHidden = true
    }
    
    override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(animated)
        self.navigationController?.navigationBar.isHidden = false
    }
    
    func initWithControl() {
        
        self.view.addSubview(self.detailView)
        detailView.snp.makeConstraints { (make) in
            make.edges.equalToSuperview()
        }
        
        self.view.addSubview(self.backButton)
        backButton.snp.makeConstraints { (make) in
            make.left.equalToSuperview().offset(Adapter(22))
            make.top.equalToSuperview().offset(getStatusBarHeight() + 10)
            make.width.height.equalTo(Adapter(30))
        }
    }
    
}
